1. /* sxcspi.cpp by K.Tsuru */
  2. // function ID 5106 BRADIX
  3. /****************************************************
  4. SDecimal and SDouble class
  5. pi by Stormer's formura
  6. pi/4 = 6*arctan(1/8) + 2*arctan(1/57) + arctan(1/239)
  7. *****************************************************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. SDecimal BStomerPi(){
  12. SDecimal pi, y;
  13. XsMult(Batan2(1, 8), 6, pi); // 6*atan(1/8)
  14. XsMult(Batan2(1, 57), 2, y); // y = 2*atan(1/57)
  15. XXAdd(pi, y, pi);
  16. y = Batan2(1, 239);
  17. XXAdd(pi, y, pi);
  18. XsMult(pi, 4, pi);
  19. return pi;
  20. }
  21. // function ID 3509 DRADIX
  22. SDouble StomerPi(){
  23. return BStomerPi().ConvToDec();
  24. }

sxcspi.cpp : last modifiled at 2016/09/21 09:16:24(655 bytes)
created at 2016/10/31 11:11:16
The creation time of this html file is 2017/10/27 15:45:59 (Fri Oct 27 15:45:59 2017).